package org.gwt.pluginframework.development.client;

import org.gwt.pluginframework.common.IPluginManager;
import org.gwt.pluginframework.common.event.PluginEvent;
import org.gwt.pluginframework.development.DevelopmentApplication;
import org.gwt.pluginframework.development.DevelopmentDockExtension;
import org.gwt.pluginframework.plugin.BaseStatusBarEventInvoker;
import org.gwt.pluginframework.plugin.StatusBarEventInvoker;

/* I you want to use DevelopmentApplication (something to ease 
 * process of development you need to extend DevelopmentApplication.
 * 
 * There are several method which can be extended to initialize 
 * your development environment.
 * 
 *    # registerPlugins - is used to register plugins which you are
 *             currently working with
 *    # embedOnDockExtension - is used to put your plugin on the main
 *    		   area in the screen (the screen is split into 2 parts, 
 *    		   at the bottom there is developer toolbar)
 *    # registerCustomEvents - is used to register events which can
 *    		   be triggered to test form responsivness.		   
 * 
 */
public class DevelopmentExample extends DevelopmentApplication {

	PluginExample plugin = new PluginExample();

	@Override
	public void registerPlugins(IPluginManager manager) {
		manager.registerPlugin(plugin);
	}

	@Override
	public DevelopmentDockExtension embedOnDockExtension() {
		DevelopmentDockExtension result = super.embedOnDockExtension();
		result.add(plugin.getPanel());
		return result;
	}
	
	@Override
	public StatusBarEventInvoker[] registerCustomEvents() {
		return new StatusBarEventInvoker[] {
				new BaseStatusBarEventInvoker("my", new PluginEvent("my")),
				new BaseStatusBarEventInvoker("asdf", new PluginEvent("asdf"))
			};
	}
}
